Fix issue with newly created template under an existing one #19669
+4
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites
Resolves: #19632
Description
The linked issue illustrates problems when creating a template under an existing one - the newly created template loses it's updates and appears to have changes when it doesn't.
The problem looks to occur when we attempt to load the newly created template and we don't get the data returned from the API, rather the originally scaffolded content.
Resetting the state before loading as I've done here does fix the problem - but it may be more something that illustrates the problem and a more competent front-end reviewer can find to do in a better way.
Testing
Create a template under and existing one, and verify the master template is correctly identified for subsequent editing.